package com.pucrs.ads.simulator;

import com.pucrs.ads.main.Main;

public class Event implements Comparable<Event> {
	private EventType type;
	private Double when;
	private Double pseudoRandom;
	
	public Event(EventType type, Double when, Double pseudoRandom){
		this.type = type;
		this.when = when;
		this.pseudoRandom = pseudoRandom;
	}
	public EventType getType() {
		return type;
	}
	public void setType(EventType type) {
		this.type = type;
	}
	public double getWhen() {
		return when;
	}
	public void setWhen(double when) {
		this.when = when;
	}
	@Override
	public int compareTo(Event arg0) {
		return when.compareTo(arg0.getWhen()); 
	}
	public Double getPseudoRandom() {
		return pseudoRandom;
	}
	public void setPseudoRandom(Double pseudoRandom) {
		this.pseudoRandom = pseudoRandom;
	}
	public String toString(){
		StringBuilder sb = new StringBuilder();
		sb.append("Evento: ");
		sb.append(this.type);
		sb.append(" Tempo: ");
		sb.append(Main.DF.format(this.when));
		sb.append(" Pseudo: ");
		sb.append(Main.DF.format(this.pseudoRandom));
		return sb.toString();
	}

}
